package com.study;

/**
 * @Description: TODO
 * @Author: csc
 * @Date: 2024/10/17 11:52
 * @Version: 1.0
 **/
public class D {

    //需求是 将上面字符串每隔两位添加一个\  类似 \x0F\x01\x00\x00\x06\x00\xCD\xDC
    public static String add(String str){
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            sb.append(str.charAt(i));
            if((i+1)%2==0){
                sb.append("\\");
            }
        }
        return sb.toString();
    }



    //0B0142918a3d42390a3d4286b333428200004170000043948000449ce000443c00004478447b45ada00041eb333340efae14429ff5c341a0b852407f5c293d75c28f3d75c28f3db851ec3f0ccccd4291d1ec423a1eb84284b333428200004170000043950000449cc000443d0000447837ae45ad880041ed999a40f00000429fdc2941a0a3d7407f5c293d75c28f3d75c28f3db851ec3f0a3d71CDDC
    public static void main(String[] args) {

        // 312

        String str ="0B0142918a3d42390a3d4286b333428200004170000043948000449ce000443c00004478447b45ada00041eb333340efae14429ff5c341a0b852407f5c293d75c28f3d75c28f3db851ec3f0ccccd4291d1ec423a1eb84284b333428200004170000043950000449cc000443d0000447837ae45ad880041ed999a40f00000429fdc2941a0a3d7407f5c293d75c28f3d75c28f3db851ec3f0a3d71CDDC";
        System.out.println(str.length());
        String add = add(str);
        System.out.println(add);


    }
}
